home *** CD-ROM | disk | FTP | other *** search
- /*
- Copyright © 1991-1995 by TopSoft Inc. All rights reserved.
-
- You may distribute this file under the terms of the TopSoft
- Artistic License, accompanying this package.
-
- This file was developed by George (ty) Tempel in connection with TopSoft, Inc..
- See the Modification History for more details.
-
- Product
- About Box
-
- FILE
- ABTopic.h
-
- NAME
- ABTopic.h, part of the ABox project source code,
- responsible for handling the AboutBox topic class stuff.
-
- DESCRIPTION
- This file contains defines for the about box modules.
-
- DEVELOPED BY
- George (ty) Tempel netromancr@aol.com
- All code in this file, and its associated header file was
- Created by George (ty) Tempel in connection with the TopSoft, Inc.
- "FilterTop" application development, except where noted.
-
- CARETAKER - George (ty) Tempel <netromancr@aol.com>
- Please consult this person for any changes or suggestions to this file.
-
- MODIFICATION HISTORY
-
- dd mmm yy - xxx - patchxx: description of patch
- 9 June 94 - ty - Initial Version Created
- 20-july-94 - ty - initial version released
- 28-july-94 - ty - 1.0.6---removed the cursor stuff to the
- mix-in class ABUCursor
- 23-may-95 - ty - changes for compatibility with the CodeWarrior CW6
- release and the associated Universal Headers from Apple:
- most methods that returned references now have "Ref" at
- the end of their methods names to prevent possible collisions
- with datatypes and classes of the same name (older versions
- of the compiler didn't have a problem with this).
-
- */
-
- /*===========================================================================*/
-
- /*========== Exclusion Macros ============*/
-
- #pragma once
-
- #ifndef _ABTopic_
- #define _ABTopic_
-
-
- /*============ Header Files ==============*/
-
- #include "ABLinkedList.h"
- #include "ABObject.h"
- #include "ABSlide.h"
-
- /*=========== External Linkage ===========*/
-
- /*================ Macros ================*/
-
- /*============== Constants ===============*/
-
- // kABTopicSlideResource is the topic/slide resource, found in every file
- // that should appear in the about box topic list (including the application
- // if you wish to have default or primary slides).
- //
- #define kABTopicSlideResource 'TSAb'
-
-
- /*================ Enums =================*/
-
- enum ETopicType { ETopicType_OtherTopic, ETopicType_Topic, ETopicType_MovieTopic };
-
- // these are properties...
-
- #define kABTopicIndex 'Tidx'
- #define kABTopicIndexSize (sizeof(ABIndex))
-
- #define kABTopicNumberOfSlides 'Tnsl'
- #define kABTopicNumberOfSlidesSize (sizeof(ABListCount))
-
- #define kABTopicFSSpec 'Tfss'
- #define kABTopicFSSpecSize (sizeof(FSSpec))
-
- #define kABTopicName 'Tnam'
- #define kABTopicNameSize (sizeof(Str255))
-
- #define kABTopicDepth 'Tdep'
- #define kABTopicDepthSize (sizeof(long))
-
- #define kABTopicType 'Ttyp'
- #define kABTopicTypeSize (sizeof(ETopicType))
-
- #define kABBadTopicFileRefNum ((short)-1)
-
- /*=============== Structs ================*/
-
- /*=============== Typedefs ===============*/
-
- /*=========== Class Definitions ==========*/
-
- #define kABTopicSuperProperties ABObject
- class ABTopic : public ABLink, public ABObject
- {
- friend class ABTopicList;
-
- public:
- ABTopic(void);
- ABTopic(const FSSpec& inTopicFSSpec);
- virtual ~ABTopic(void);
-
- virtual OSErr GetProperty (ABProperty prop,
- void *ptr,
- long *ptrSize);
- virtual OSErr SetProperty (ABProperty prop,
- void *ptr,
- long ptrSize);
-
- virtual OSErr Draw(WindowPtr window);
- virtual OSErr Update(WindowPtr window);
- virtual Boolean Event(EventRecord *event);
- virtual OSErr Stop(void);
-
- virtual OSErr NextSlide(void);
- virtual OSErr PreviousSlide(void);
- virtual ABSlide* CurrentSlide(void);
- virtual OSErr GotoSlide(long number);
-
- virtual OSErr Resize (Rect const *field);
-
- OSErr ResizeAndDraw(Rect& inItemRect, WindowPtr inWindow);
-
- Boolean HasNameRef(void) const { return this->NameRef() != NULL; }
- Boolean DoesntHaveNameRef(void) const { return ! this->HasNameRef(); }
- StringPtr GetNameRef(void) const { return this->NameRef(); }
-
- Boolean HasSlides(void) const { return this->SlidesRef() != NULL; }
- Boolean DoesntHaveSlidesRef(void) const { return ! this->HasSlides(); }
-
- Boolean HasFSSpecPointer(void) const { return this->FSSpecPointerRef() != NULL; }
- Boolean DoesntHaveFSSpecPointer(void) const { return ! this->HasFSSpecPointer(); }
-
- Boolean HasValidFileRefNum(void) const { return this->FileRefNumRef() != kABBadTopicFileRefNum; }
- Boolean HasInvalidFileRefNum(void) const { return !this->HasValidFileRefNum(); }
- Boolean DoesntHaveValidFileRefNum(void) const { return this->HasInvalidFileRefNum(); }
-
- Boolean HasFileRefNum(void) const { return this->FileRefNumRef() != kABBadTopicFileRefNum && this->FileRefNumRef() > 0; }
- Boolean DoesntHaveFileRefNum(void) const { return ! this->HasFileRefNum(); }
-
- long GetDepth(void) const { return this->Depth(); }
- long SetDepth(long inDepth) { return this->Depth() = inDepth; }
-
- protected:
- void ResetFileInfo(void);
- void ResetFileRefNum(void);
- void ResetFSSpecPointer(void);
- void ResetSlideInfo(void);
-
- OSErr Load (void);
- OSErr Load (short inFileRefNumber);
-
- // every subclass of ABTopic overrides the DoLoad and DoCheckSlides methods
- // to provide their own functionality.
- virtual OSErr DoLoad (void);
- virtual short DoCheckSlides (void);
-
- virtual OSErr CheckAndCopyFSSpec (const FSSpec& file);
-
- short UseTopicResFile(void) const;
-
- virtual OSErr OpenTopic (void);
- virtual OSErr CloseTopic (void);
- OSErr CloseTopicFile (void);
- OSErr CloseTopicFile (OSErr inError);
-
- StringPtr mName;
- ABLinkedList* mSlides;
- FSSpecPtr mFSSpecPtr;
- long mDepth;
- short mFileRefNum;
- ETopicType mTopicType;
-
- StringPtr& NameRef(void) const { return this->mName; }
- ABLinkedList*& SlidesRef(void) const { return this->mSlides; }
- FSSpecPtr& FSSpecPointerRef(void) const { return this->mFSSpecPtr; }
- long& Depth(void) const { return this->mDepth; }
- short& FileRefNumRef(void) const { return this->mFileRefNum; }
- short GetFileRefNum(void) const { return this->FileRefNumRef(); }
- ETopicType& TopicType(void) const { return this->mTopicType; }
-
- private:
- void InitializeTopic(void);
- };
-
-
-
-
-
-
- /*========== Function Prototypes =========*/
-
-
-
-
- #endif // _ABTopic_
-
-